package com.cn.controller;

import com.cn.bean.Book;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

@Controller
public class bookController {

    @RequestMapping(value = "/insertbook")
    public String insertBook(Book book){
        System.out.println(book);
        return "book";
    }

    @RequestMapping("/bookApi")
    public String test(HttpSession session, HttpServletRequest request){
        request.setAttribute("reqParam","我是请求域中的");
        session.setAttribute("sessionParam","我是session中的");
        System.out.println(request.getAttribute("reqParam"));
        return "book";
    }
}
